//
//  SidleModel.m
//  TT
//
//  Created by Lenny on 16/4/18.
//  Copyright © 2016年 Lenny. All rights reserved.
//

#import "SidleModel.h"

@implementation SidleModel

- (NSString *)timeStrWithDate:(NSDate *)date {
    
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"HH:mm"];
    return [dateFormatter stringFromDate:date];
}


- (NSString *)timeStrWithRate:(CGFloat)rate {

    NSTimeInterval timeInt = [self.endDate timeIntervalSinceDate:self.startDate];
    NSInteger currRateInt = timeInt * rate;
    NSDate *date = [NSDate dateWithTimeInterval:currRateInt sinceDate:self.startDate];
    return [self timeStrWithDate:date];
}



@end
